//导入 mongoose
//const { time } = require('@pupbot/core');
const mongoose = require('mongoose');
//创建文档的结构对象
//设置集合中文档的属性以及属性值的类型
let itemsSchema =  new mongoose.Schema({
  id:String,
  url:String,
  src:String
});
let taskSchema = new mongoose.Schema({
  orderNumber:String,
  taskNumber:String,
  url:String,
  src:String,
  items:[itemsSchema],
  price:Number,
  order_id:String,
  shopName:String,
  AliName:String,
  buyer:String,
  order_num:Number,
  task_num:Number,//文档条数预留字段统计任务数据
  Paid:String,//付款
  Received:String,//收货
  Evaluated:String,//评价
  is_comment:Boolean,//是否提交评价
  is_trade:Boolean,//是否付款完成
  taskType:String,
  state: String,
  creatDay:String,
  creatDate:Date,
  last_time: Date,
  task_time: Date
});

//创建模型对象  对文档操作的封装对象
let taskModel = mongoose.model('task', taskSchema);

//暴露模型对象
module.exports = taskModel;
